package com.example.kugou.pojo;

import com.example.kugou.common.music.Mp3Info;
import com.example.kugou.common.music.Music;
import com.example.kugou.common.time.TimeAdd;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.Date;
import java.util.List;

/**
 * 歌曲
 */
@ApiModel("歌曲实体")
public class Sing {
    /**
     * 歌曲id
     */
    @ApiModelProperty("歌曲id")
    private Integer nid;
    /**
     * 歌名
     */
    @ApiModelProperty("歌名")
    private String nname;
    /**
     * 上传时间
     */
    @ApiModelProperty("上传时间")
    private Date time2;
    /**
     * 存放歌词路径
     */
    @ApiModelProperty("歌词路径")
    private String lrcSrc;

    /**
     * 歌曲的路径
     */
    @ApiModelProperty("歌曲路径")
    private String audioSrc;
    /**
     * 类别  ( 会员歌曲     非会员歌曲 )
     */
    @ApiModelProperty("类别")
    private Integer type;

    /**
     * 歌手id
     */
    @ApiModelProperty("歌手id")
    private Integer singerId;

    /**
     * 歌曲时长
     */
    @ApiModelProperty("歌曲时长")
    private String totalTimeStr;
    /**
     * 歌曲介绍
     */
    @ApiModelProperty("歌曲介绍")
    private String introduce;

    private Integer song_sheetid;

    private String imgSrc;

    private Album album;

    private List<Mv> mvs;

    private Singer singer;

    public void setMusic(Music music){
        this.audioSrc = music.getMusicPath();
        this.lrcSrc = music.getLrcPath();
        this.nname = music.getSongName();
        this.time2 = new Date();
        this.totalTimeStr = TimeAdd.getTimeString((int)music.getTotalTimeStr());
        if(music.getComment() == null || music.getComment().equals("")){
            this.introduce = "该歌手没有描述";
        }else{
            this.introduce = music.getComment();
        }
    }


    public void setMusic(Mp3Info mp3Info){
        this.audioSrc = mp3Info.getMusicPath();
        this.nname = mp3Info.getSongName();
        this.singerId = mp3Info.getSingerId();
        this.time2 = new Date();
        this.totalTimeStr = TimeAdd.getTimeString((int)mp3Info.getDuration());
    }


    public String getIntroduce() {
        return introduce;
    }

    public void setIntroduce(String introduce) {
        this.introduce = introduce;
    }

    public Integer getSong_sheetid() {
        return song_sheetid;
    }

    public void setSong_sheetid(Integer song_sheetid) {
        this.song_sheetid = song_sheetid;
    }

    public Singer getSinger() {
        return singer;
    }

    public void setSinger(Singer singer) {
        this.singer = singer;
    }

    public List<Mv> getMvs() {
        return mvs;
    }

    public void setMvs(List<Mv> mvs) {
        this.mvs = mvs;
    }

    public Album getAlbum() {
        return album;
    }

    public void setAlbum(Album album) {
        this.album = album;
    }



    public Sing() {
    }

    public Integer getNid() {
        return nid;
    }

    public void setNid(Integer nid) {
        this.nid = nid;
    }

    public String getNname() {
        return nname;
    }

    public void setNname(String nname) {
        this.nname = nname;
    }

    public Date getTime2() {
        return time2;
    }

    public void setTime2(Date time2) {
        this.time2 = time2;
    }

    public String getLrcSrc() {
        return lrcSrc;
    }

    public void setLrcSrc(String lrcSrc) {
        this.lrcSrc = lrcSrc;
    }



    public String getAudioSrc() {
        return audioSrc;
    }

    public void setAudioSrc(String audioSrc) {
        this.audioSrc = audioSrc;
    }

    public Integer getSingerId() {
        return singerId;
    }

    public void setSingerId(Integer singerId) {
        this.singerId = singerId;
    }

    public String getTotalTimeStr() {
        return totalTimeStr;
    }

    public void setTotalTimeStr(String totalTimeStr) {
        this.totalTimeStr = totalTimeStr;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getImgSrc() {
        return imgSrc;
    }

    public void setImgSrc(String imgSrc) {
        this.imgSrc = imgSrc;
    }

    public Sing(Integer nid, String nname, Date time2, String lrcSrc,  String audioSrc, Integer type, Integer singerId, String totalTimeStr, String introduce, Integer song_sheetid, String imgSrc) {
        this.nid = nid;
        this.nname = nname;
        this.time2 = time2;
        this.lrcSrc = lrcSrc;
        this.audioSrc = audioSrc;
        this.type = type;
        this.singerId = singerId;
        this.totalTimeStr = totalTimeStr;
        this.introduce = introduce;
        this.song_sheetid = song_sheetid;
        this.imgSrc = imgSrc;
    }

    @Override
    public String toString() {
        return "Sing{" +
                "nid=" + nid +
                ", nname='" + nname + '\'' +
                ", time2=" + time2 +
                ", lrcSrc='" + lrcSrc + '\'' +
                ", audioSrc='" + audioSrc + '\'' +
                ", type=" + type +
                ", singerId=" + singerId +
                ", totalTimeStr=" + totalTimeStr +
                ", introduce='" + introduce + '\'' +
                ", song_sheetid=" + song_sheetid +
                ", imgSrc='" + imgSrc + '\'' +
                ", album=" + album +
                ", mvs=" + mvs +
                ", singer=" + singer +
                '}';
    }
}
